<template>
  <div>
    <a-card :bordered="false">
      <a-tabs v-model="activeKey">
        <a-tab-pane
          key="1"
        >
          <span slot="tab">
          <a-icon type="bars" />
           调度日志记录
          </span>
          <schedulerLog ref="schedulerLog" v-if="activeKey === '1'" />
        </a-tab-pane>

        <a-tab-pane
          key="2"
        >
          <span slot="tab">
           <a-icon type="warning" />
            调度异常告警
          </span>
          <schedulerAlarm ref="schedulerAlarm" v-if="activeKey === '2'" />
        </a-tab-pane>
      </a-tabs>
    </a-card>
  </div>
</template>

<script>
  import SchedulerLog from "./modules/SchedulerLog";
  import SchedulerAlarm from "./modules/SchedulerAlarm";

  export default {
    name: "F030203",
    components: {
      SchedulerLog,
      SchedulerAlarm
    },
    data() {
      return {
        activeKey: '1'
      }
    },
    created() {},
    methods: {
      handleTabChange() {
        let key = this.activeKey;
        if (key === '1' && this.$refs.schedulerLog) {
          this.$refs.schedulerLog.loadData();
        } else if (key === '2' && this.$refs.schedulerAlarm) {
          this.$refs.schedulerAlarm.loadData();
        }
      },
    },
  }
</script>